import axios from '@/utils/request'

// 用户的登录功能
export function login (mobile, code) {
  return axios({
    method: 'post',
    url: '/mp/v1_0/authorizations',
    data: {
      mobile,
      code
    }
  })
}

// 获取粉丝
export function getFansList ({ params }) {
  return axios({
    method: 'get',
    url: '/mp/v1_0/followers',
    params
  })
}

// 获取粉丝的统计数量
export function getFansCount () {
  return axios({
    method: 'get',
    url: '/mp/v1_0/statistics/followers'
  })
}

// 获取用户的个人资料
export function getUserInfo () {
  return axios({
    method: 'get',
    url: '/mp/v1_0/user/profile'
  })
}

// 修改个人设置的个人信息
export function changeUserInfo (data) {
  return axios({
    method: 'patch',
    url: '/mp/v1_0/user/profile',
    data
  })
}

// 上传头像
export function updateUserAvt (fd) {
  return axios({
    method: 'patch',
    url: '/mp/v1_0/user/photo',
    data: fd
  })
}
